package com.gfeeling.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gfeeling.dao.BaseDao;
import com.gfeeling.model.Log;
import com.gfeeling.service.LogService;
import com.gfeeling.utils.DateUtils;
@Service
public class LogServiceImpl extends BaseServiceImpl<Log> implements LogService{
	@Autowired
	private BaseDao<Log> logDao;
	@Override
	public int delLogForDate(String date) {
		//return logDao.executeHql("DELETE FROM Log l WHERE l.createTime <'" + date+"'");
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("createTime",DateUtils.parseDate(date));
		return logDao.executeHql("DELETE FROM Log WHERE createTime < :createTime",map);
	}

}
